import moment from 'moment'
const test = function (value) {
    return;
}
const dateFmt = function (timestamp, pattern) {
    if (timestamp == undefined || timestamp == null || timestamp == '') {
        return "";
    }
    if (pattern == null) pattern = 'YYYY-MM-DD HH:mm:ss'
    return moment(timestamp).format(pattern)
}
const commentFmt = function (value, map) {
    if (value == undefined || value == null || value == ''){
        console.info('commentFmt value is null');
        return '';
    }
    if(map==undefined||map==null){
        console.info('commentFmt map is null');
        return '';
    }
    return map[value];

}
const firstChar = function (value) {
    if(value==null|value==''||value==undefined)
        return '';
return value.charAt(0);
}





export default {
    commentFmt,
    dateFmt,
    firstChar,
}
